<template>
  <div>
    <a-select v-model="text" placeholder="请选择" style="width: 175px" option-label-prop="label" @change="selectClick">
      <a-select-option v-for="(item, index) in dataForm" :key="index" :value="item.id" :label="item.coachName">
        <div slot="title" style="display: flex; flex-direction: row; justify-content: space-between">
          <div>{{ item.coachName }}</div>
          <div>{{ item.realName }}</div>
        </div>
      </a-select-option>
    </a-select>
  </div>
</template>

<script>
import { xhdjCoachInfoList } from '@/api/manage'
import { getAction } from '@/api/manage'
export default {
  props: { value: '' },
  data () {
    return {
      dataForm: [],
      text: undefined
    }
  },
  created () {
    this.init()
  },
  methods: {
    async init () {
      const res = await xhdjCoachInfoList({
        pageNo: 1,
        pageSize: 1000
      })
      console.log(res.result.records, '技师数据')
      this.dataForm = res.result.records
    },
    selectClick (value) {
      this.$emit('selectClick', value)
    }
  },
  watch: {
    value (val) {
      if (!val) {
        this.text = undefined
      } else {
        return
      }
    }
  }
}
</script>

<style scoped></style>
